//package com.ykh.util;
//
//import com.ykh.pojo.po.Video;
//import lombok.Data;
//
//import java.util.Comparator;
//
///**
// * 视频排序比较器
// */
//@Data
//public
//class VideoComparator implements Comparator<Video> {
//
//    public int compare(Video v1, Video v2) {
//        //compare by favorites
//        int compareCollect = Long.compare(v2.getCollectNum(), v1.getCollectNum());
//        if (compareCollect != 0) {
//            return compareCollect;
//        }
//
//        //if favorites are equal, compare by likes
//        int compareLikes = Long.compare(v2.getLikeNum(), v1.getLikeNum());
//        if (compareLikes != 0) {
//            return compareLikes;
//        }
//
//        //if likes are also equal, compare by views
//        return Long.compare(v2.getPlayNum(), v1.getPlayNum());
//    }
//}